package com.lglbc;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author 乐哥聊编程
 * @Doc 关注公众号"乐哥聊编程"获取文档和源码
 * @Date 2023/6/17
 * @Description
 */
@FeignClient(name = "service2", fallback = Service2FeignFallback.class)
public interface Service2Feign {
    @GetMapping("/service2")
    public String service2(@RequestParam("name") String name);
}
@Component
class Service2FeignFallback implements Service2Feign {

    @Override
    public String service2(String name) {
        return "service2 调用失败";
    }
}

